(function(global, factory) {
  typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("vue")) : typeof define === "function" && define.amd ? define(["vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.button = factory(global.Vue));
})(this, function(vue) {
  "use strict";
  const index = "";
  const ButtonType = ["primary", "success", "info", "warning", "danger", "text"];
  const ButtonSize = ["midium", "small", "mini"];
  const buttonProps = {
    type: {
      type: String,
      validator(value) {
        return ButtonType.includes(value);
      }
    },
    plain: Boolean,
    round: Boolean,
    disabled: Boolean,
    icon: String,
    iconPosition: String,
    size: {
      type: String,
      validator(value) {
        return ButtonSize.includes(value);
      }
    }
  };
  const _sfc_main = vue.defineComponent({
    name: "MButton",
    props: buttonProps,
    setup(props) {
      const styleClass = vue.computed(() => {
        return {
          [`m-button--${props.type}`]: props.type,
          "is-plain": props.plain,
          "is-round": props.round,
          "is-disabled": props.disabled,
          [`m-button--${props.size}`]: props.size
        };
      });
      const iconFont = vue.computed(() => {
        const iconName = props.icon;
        const position = props.iconPosition;
        return {
          iconName,
          position
        };
      });
      return {
        styleClass,
        iconFont
      };
    }
  });
  const _export_sfc = (sfc, props) => {
    const target = sfc.__vccOpts || sfc;
    for (const [key, val] of props) {
      target[key] = val;
    }
    return target;
  };
  const _hoisted_1 = { class: "m-button-text" };
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
    return vue.openBlock(), vue.createElementBlock("button", {
      class: vue.normalizeClass(["m-button", _ctx.styleClass])
    }, [
      vue.createElementVNode("div", _hoisted_1, [
        vue.renderSlot(_ctx.$slots, "default")
      ])
    ], 2);
  }
  const Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
  Button.install = function(app) {
    app.component(Button.name, Button);
  };
  return Button;
});
